/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author guillaumediliberatore
 */
@Entity
@Table(name = "courtier")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Courtier.findAll", query = "SELECT c FROM Courtier c"),
    @NamedQuery(name = "Courtier.findByMotdepassecourtier", query = "SELECT c FROM Courtier c WHERE c.motdepassecourtier = :motdepassecourtier"),
    @NamedQuery(name = "Courtier.findByIdcourtier", query = "SELECT c FROM Courtier c WHERE c.idcourtier = :idcourtier"),
    @NamedQuery(name = "Courtier.findByLogincourtier", query = "SELECT c FROM Courtier c WHERE c.logincourtier = :logincourtier")})
public class Courtier implements Serializable {
    private static final long serialVersionUID = 1L;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 30)
    @Column(name = "motdepassecourtier")
    private String motdepassecourtier;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idcourtier")
    private Integer idcourtier;
    @Size(max = 40)
    @Column(name = "logincourtier")
    private String logincourtier;

    public Courtier() {
    }

    public Courtier(Integer idcourtier) {
        this.idcourtier = idcourtier;
    }

    public Courtier(String logincourtier, String motdepassecourtier) {
        this.logincourtier = logincourtier;
        this.motdepassecourtier = motdepassecourtier;
    }

    public String getMotdepassecourtier() {
        return motdepassecourtier;
    }

    public void setMotdepassecourtier(String motdepassecourtier) {
        this.motdepassecourtier = motdepassecourtier;
    }

    public Integer getIdcourtier() {
        return idcourtier;
    }

    public void setIdcourtier(Integer idcourtier) {
        this.idcourtier = idcourtier;
    }

    public String getLogincourtier() {
        return logincourtier;
    }

    public void setLogincourtier(String logincourtier) {
        this.logincourtier = logincourtier;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idcourtier != null ? idcourtier.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Courtier)) {
            return false;
        }
        Courtier other = (Courtier) object;
        if ((this.idcourtier == null && other.idcourtier != null) || (this.idcourtier != null && !this.idcourtier.equals(other.idcourtier))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.Courtier[ idcourtier=" + idcourtier + " ]";
    }
    
}
